﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using QuanLiThuVien.Source;
using QuanLiThuVien.LinkModel;
using System.Data;

namespace QuanLiThuVien
{
    /// <summary>
    /// Interaction logic for BaoCaoThongKeSachTraTre.xaml
    /// </summary>
    public partial class BaoCaoThongKeSachTraTre : Page
    {
        private THUVIEN.Service1 serv = new THUVIEN.Service1();
        private ShowInfo m_showInfo = new ShowInfo();
        private InsertInfo m_insertInfo = new InsertInfo();

        public BaoCaoThongKeSachTraTre()
        {
            InitializeComponent();
        }

        private void bntBaoCaoTT_Click(object sender, RoutedEventArgs e)
        {
            if (dtmNgayTra.SelectedDate == null)
                MessageBox.Show("Phải chọn ngày báo cáo", "Thông báo");
            else
                m_showInfo.SelectBCTraTre(dataBaoCaoSachTT, DateTime.Parse(dtmNgayTra.SelectedDate.ToString()));
        }

        private void bntXuatFileTT_Click(object sender, RoutedEventArgs e)
        {
            DataSet dataSet = new DataSet();

            dataSet = serv.ExportBCTraTre(DateTime.Parse(dtmNgayTra.SelectedDate.ToString()));
            Export.exportExcel("Báo cáo sách trả trễ", dataSet);
        }
    }
}
